//
//  TimeDetailTableViewCell.m
//  TaiHao
//
//  Created by rzm on 16/6/3.
//  Copyright © 2016年 rzm. All rights reserved.
//

#import "SmapuxTimeChooseCellSub.h"

@implementation SmapuxTimeChooseCellSub

- (void)awakeFromNib {
    [super awakeFromNib];
    
    
    if (self.SelectedBtn.selected) {
        self.SelectedBtn.backgroundColor = [UIColor redColor];
        _dateLabel.text = _dateStr;
        _speedLabel.text = _speedStr;
    }
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    
    [self layoutIfNeeded];
    self.SelectedBtn.layer.cornerRadius = self.SelectedBtn.height/2;
//    self.SelectedBtn.backgroundColor = RandomColor;

}

- (IBAction)IsSelectedOrNot:(id)sender {
    UIButton *btn = (UIButton *)sender;
    btn.selected = !btn.selected;
    
    if (btn.selected) {
        btn.backgroundColor = [UIColor redColor];
        _dateLabel.text = _dateStr;
        _speedLabel.text = _speedStr;
    }else
    {
        btn.backgroundColor = [UIColor blackColor];
        _dateLabel.text = @"00:00";
        _speedLabel.text = @"0 X";
    }
    
}

- (void)setDateStr:(NSString *)dateStr
{
    _dateStr = dateStr;
//    _dateLabel.text = _dateStr;

}

- (void)setSpeedStr:(NSString *)speedStr
{
    _speedStr = speedStr;
//    _speedLabel.text = _speedStr;

}
@end
